using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace Slqj.Data
{
	public static class TableGuestRoomQty
	{
		public const string Table = "GuestRoomQty";
		public const string GuestRoomQtyID = "GuestRoomQtyID";
		public const string GuestRoomID = "GuestRoomID";
		public const string Quantity = "Quantity";
		public const string ApplyDate = "ApplyDate";
	}
	
	[Serializable]
	public class BaseGuestRoomQty
		: IDbSessionEntity, IJsonClass
	{
		int m_GuestRoomQtyID;
		/// <summary>
        /// 
        /// </summary>
        public int GuestRoomQtyID
        {
            get { return m_GuestRoomQtyID; }
            set { m_GuestRoomQtyID = value; }
        }
		
		int? m_GuestRoomID;
		/// <summary>
        /// 
        /// </summary>
        public int? GuestRoomID
        {
            get { return m_GuestRoomID; }
            set { m_GuestRoomID = value; }
        }
		
		int m_Quantity;
		/// <summary>
        /// 
        /// </summary>
        public int Quantity
        {
            get { return m_Quantity; }
            set { m_Quantity = value; }
        }
		
		DateTime m_ApplyDate;
		/// <summary>
        /// 
        /// </summary>
        public DateTime ApplyDate
        {
            get { return m_ApplyDate; }
            set { m_ApplyDate = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_GuestRoomQtyID = reader[TableGuestRoomQty.GuestRoomQtyID];
            m_GuestRoomID = reader[TableGuestRoomQty.GuestRoomID];
            m_Quantity = reader[TableGuestRoomQty.Quantity];
            m_ApplyDate = reader[TableGuestRoomQty.ApplyDate];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableGuestRoomQty.GuestRoomQtyID, PrimaryKeyType.Identity, GuestRoomQtyID);
			writer[TableGuestRoomQty.GuestRoomID] = GuestRoomID;
			writer[TableGuestRoomQty.Quantity] = Quantity;
			writer[TableGuestRoomQty.ApplyDate] = ApplyDate;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_GuestRoomQtyID = idd;
        }
		
		public string TableName
        {
            get { return TableGuestRoomQty.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_GuestRoomQtyID = hashToRead["GuestRoomQtyID"];
			 
             m_GuestRoomID = hashToRead["GuestRoomID"];
			 
             m_Quantity = hashToRead["Quantity"];
			 
             m_ApplyDate = hashToRead["ApplyDate"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["GuestRoomQtyID"] = GuestRoomQtyID;
			 
            hashToFill["GuestRoomID"] = GuestRoomID;
			 
            hashToFill["Quantity"] = Quantity;
			 
            hashToFill["ApplyDate"] = ApplyDate;
			 
        }

        #endregion
		
	}
}
